package com.sinosoft.content;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.compass.annotations.Searchable;
import org.compass.annotations.SearchableId;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.sinosoft.base.Constants;

@Entity
@Table(name = "ZYWX_CONTENT_EN")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Searchable
public class ContentEn {

	private Long contentId; // 编号
	private String contentTitle; // 标题
	private String content; // 内容（用于显示）
	private Long isRelease; // 是否发布
	private Long contentType; // 文章类型
	private Date contentTime; // 发布时间

	private byte[] contentClob;// 库中的文章内容

	@Transient
	public String getLanguage() {
		return Constants.TABLE_TYPE_CONTENT_EN;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@SearchableId
	@Column(name = "CONTENTID")
	public Long getContentId() {
		return contentId;
	}

	public void setContentId(Long contentId) {
		this.contentId = contentId;
	}

	@Column(name = "CONTENTTITLE")
	public String getContentTitle() {
		return contentTitle;
	}

	public void setContentTitle(String contentTitle) {
		this.contentTitle = contentTitle;
	}
	@Transient
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "ARTICLES", columnDefinition = "BLOB", nullable = true)
	public byte[] getContentClob() {
		return contentClob;
	}

	public void setContentClob(byte[] contentClob) {
		this.contentClob = contentClob;
	}

	@Column(name = "ISRELEASE")
	public Long getIsRelease() {
		return isRelease;
	}

	public void setIsRelease(Long isRelease) {
		this.isRelease = isRelease;
	}

	@Column(name = "CONTENTTYPE")
	public Long getContentType() {
		return contentType;
	}

	public void setContentType(Long contentType) {
		this.contentType = contentType;
	}

	@Column(name = "CREATETIME")
	public Date getContentTime() {
		return contentTime;
	}

	public void setContentTime(Date contentTime) {
		this.contentTime = contentTime;
	}
}
